package wint.dal.jdbc;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.Date;
import java.sql.NClob;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;

public class LazyPreparedStatement implements PreparedStatement {
	
	private String sql;
	
	private PreparedStatement targetPreparedStatement;

	public LazyPreparedStatement(String sql, PreparedStatement targetPreparedStatement) {
		super();
		this.sql = sql;
		this.targetPreparedStatement = targetPreparedStatement;
	}

	public ResultSet executeQuery(String sql) throws SQLException {
		return targetPreparedStatement.executeQuery(sql);
	}

	public <T> T unwrap(Class<T> iface) throws SQLException {
		return targetPreparedStatement.unwrap(iface);
	}

	public ResultSet executeQuery() throws SQLException {
		return targetPreparedStatement.executeQuery();
	}

	public int executeUpdate(String sql) throws SQLException {
		return targetPreparedStatement.executeUpdate(sql);
	}

	public boolean isWrapperFor(Class<?> iface) throws SQLException {
		return targetPreparedStatement.isWrapperFor(iface);
	}

	public int executeUpdate() throws SQLException {
		return targetPreparedStatement.executeUpdate();
	}

	public void close() throws SQLException {
		targetPreparedStatement.close();
	}

	public void setNull(int parameterIndex, int sqlType) throws SQLException {
		targetPreparedStatement.setNull(parameterIndex, sqlType);
	}

	public int getMaxFieldSize() throws SQLException {
		return targetPreparedStatement.getMaxFieldSize();
	}

	public void setBoolean(int parameterIndex, boolean x) throws SQLException {
		targetPreparedStatement.setBoolean(parameterIndex, x);
	}

	public void setMaxFieldSize(int max) throws SQLException {
		targetPreparedStatement.setMaxFieldSize(max);
	}

	public void setByte(int parameterIndex, byte x) throws SQLException {
		targetPreparedStatement.setByte(parameterIndex, x);
	}

	public void setShort(int parameterIndex, short x) throws SQLException {
		targetPreparedStatement.setShort(parameterIndex, x);
	}

	public int getMaxRows() throws SQLException {
		return targetPreparedStatement.getMaxRows();
	}

	public void setInt(int parameterIndex, int x) throws SQLException {
		targetPreparedStatement.setInt(parameterIndex, x);
	}

	public void setMaxRows(int max) throws SQLException {
		targetPreparedStatement.setMaxRows(max);
	}

	public void setLong(int parameterIndex, long x) throws SQLException {
		targetPreparedStatement.setLong(parameterIndex, x);
	}

	public void setEscapeProcessing(boolean enable) throws SQLException {
		targetPreparedStatement.setEscapeProcessing(enable);
	}

	public void setFloat(int parameterIndex, float x) throws SQLException {
		targetPreparedStatement.setFloat(parameterIndex, x);
	}

	public int getQueryTimeout() throws SQLException {
		return targetPreparedStatement.getQueryTimeout();
	}

	public void setDouble(int parameterIndex, double x) throws SQLException {
		targetPreparedStatement.setDouble(parameterIndex, x);
	}

	public void setQueryTimeout(int seconds) throws SQLException {
		targetPreparedStatement.setQueryTimeout(seconds);
	}

	public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
		targetPreparedStatement.setBigDecimal(parameterIndex, x);
	}

	public void cancel() throws SQLException {
		targetPreparedStatement.cancel();
	}

	public void setString(int parameterIndex, String x) throws SQLException {
		targetPreparedStatement.setString(parameterIndex, x);
	}

	public SQLWarning getWarnings() throws SQLException {
		return targetPreparedStatement.getWarnings();
	}

	public void setBytes(int parameterIndex, byte[] x) throws SQLException {
		targetPreparedStatement.setBytes(parameterIndex, x);
	}

	public void clearWarnings() throws SQLException {
		targetPreparedStatement.clearWarnings();
	}

	public void setDate(int parameterIndex, Date x) throws SQLException {
		targetPreparedStatement.setDate(parameterIndex, x);
	}

	public void setCursorName(String name) throws SQLException {
		targetPreparedStatement.setCursorName(name);
	}

	public void setTime(int parameterIndex, Time x) throws SQLException {
		targetPreparedStatement.setTime(parameterIndex, x);
	}

	public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
		targetPreparedStatement.setTimestamp(parameterIndex, x);
	}

	public boolean execute(String sql) throws SQLException {
		return targetPreparedStatement.execute(sql);
	}

	public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
		targetPreparedStatement.setAsciiStream(parameterIndex, x, length);
	}

	public ResultSet getResultSet() throws SQLException {
		return targetPreparedStatement.getResultSet();
	}

	public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
		targetPreparedStatement.setUnicodeStream(parameterIndex, x, length);
	}

	public int getUpdateCount() throws SQLException {
		return targetPreparedStatement.getUpdateCount();
	}

	public boolean getMoreResults() throws SQLException {
		return targetPreparedStatement.getMoreResults();
	}

	public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
		targetPreparedStatement.setBinaryStream(parameterIndex, x, length);
	}

	public void setFetchDirection(int direction) throws SQLException {
		targetPreparedStatement.setFetchDirection(direction);
	}

	public void clearParameters() throws SQLException {
		targetPreparedStatement.clearParameters();
	}

	public int getFetchDirection() throws SQLException {
		return targetPreparedStatement.getFetchDirection();
	}

	public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
		targetPreparedStatement.setObject(parameterIndex, x, targetSqlType);
	}

	public void setFetchSize(int rows) throws SQLException {
		targetPreparedStatement.setFetchSize(rows);
	}

	public int getFetchSize() throws SQLException {
		return targetPreparedStatement.getFetchSize();
	}

	public void setObject(int parameterIndex, Object x) throws SQLException {
		targetPreparedStatement.setObject(parameterIndex, x);
	}

	public int getResultSetConcurrency() throws SQLException {
		return targetPreparedStatement.getResultSetConcurrency();
	}

	public int getResultSetType() throws SQLException {
		return targetPreparedStatement.getResultSetType();
	}

	public void addBatch(String sql) throws SQLException {
		targetPreparedStatement.addBatch(sql);
	}

	public void clearBatch() throws SQLException {
		targetPreparedStatement.clearBatch();
	}

	public boolean execute() throws SQLException {
		return targetPreparedStatement.execute();
	}

	public int[] executeBatch() throws SQLException {
		return targetPreparedStatement.executeBatch();
	}

	public void addBatch() throws SQLException {
		targetPreparedStatement.addBatch();
	}

	public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
		targetPreparedStatement.setCharacterStream(parameterIndex, reader, length);
	}

	public void setRef(int parameterIndex, Ref x) throws SQLException {
		targetPreparedStatement.setRef(parameterIndex, x);
	}

	public Connection getConnection() throws SQLException {
		return targetPreparedStatement.getConnection();
	}

	public void setBlob(int parameterIndex, Blob x) throws SQLException {
		targetPreparedStatement.setBlob(parameterIndex, x);
	}

	public void setClob(int parameterIndex, Clob x) throws SQLException {
		targetPreparedStatement.setClob(parameterIndex, x);
	}

	public boolean getMoreResults(int current) throws SQLException {
		return targetPreparedStatement.getMoreResults(current);
	}

	public void setArray(int parameterIndex, Array x) throws SQLException {
		targetPreparedStatement.setArray(parameterIndex, x);
	}

	public ResultSetMetaData getMetaData() throws SQLException {
		return targetPreparedStatement.getMetaData();
	}

	public ResultSet getGeneratedKeys() throws SQLException {
		return targetPreparedStatement.getGeneratedKeys();
	}

	public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
		targetPreparedStatement.setDate(parameterIndex, x, cal);
	}

	public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
		return targetPreparedStatement.executeUpdate(sql, autoGeneratedKeys);
	}

	public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
		targetPreparedStatement.setTime(parameterIndex, x, cal);
	}

	public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
		return targetPreparedStatement.executeUpdate(sql, columnIndexes);
	}

	public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
		targetPreparedStatement.setTimestamp(parameterIndex, x, cal);
	}

	public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException {
		targetPreparedStatement.setNull(parameterIndex, sqlType, typeName);
	}

	public int executeUpdate(String sql, String[] columnNames) throws SQLException {
		return targetPreparedStatement.executeUpdate(sql, columnNames);
	}

	public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
		return targetPreparedStatement.execute(sql, autoGeneratedKeys);
	}

	public void setURL(int parameterIndex, URL x) throws SQLException {
		targetPreparedStatement.setURL(parameterIndex, x);
	}

	public ParameterMetaData getParameterMetaData() throws SQLException {
		return targetPreparedStatement.getParameterMetaData();
	}

	public void setRowId(int parameterIndex, RowId x) throws SQLException {
		targetPreparedStatement.setRowId(parameterIndex, x);
	}

	public boolean execute(String sql, int[] columnIndexes) throws SQLException {
		return targetPreparedStatement.execute(sql, columnIndexes);
	}

	public void setNString(int parameterIndex, String value) throws SQLException {
		targetPreparedStatement.setNString(parameterIndex, value);
	}

	public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
		targetPreparedStatement.setNCharacterStream(parameterIndex, value, length);
	}

	public boolean execute(String sql, String[] columnNames) throws SQLException {
		return targetPreparedStatement.execute(sql, columnNames);
	}

	public void setNClob(int parameterIndex, NClob value) throws SQLException {
		targetPreparedStatement.setNClob(parameterIndex, value);
	}

	public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
		targetPreparedStatement.setClob(parameterIndex, reader, length);
	}

	public int getResultSetHoldability() throws SQLException {
		return targetPreparedStatement.getResultSetHoldability();
	}

	public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
		targetPreparedStatement.setBlob(parameterIndex, inputStream, length);
	}

	public boolean isClosed() throws SQLException {
		return targetPreparedStatement.isClosed();
	}

	public void setPoolable(boolean poolable) throws SQLException {
		targetPreparedStatement.setPoolable(poolable);
	}

	public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
		targetPreparedStatement.setNClob(parameterIndex, reader, length);
	}

	public boolean isPoolable() throws SQLException {
		return targetPreparedStatement.isPoolable();
	}

	public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
		targetPreparedStatement.setSQLXML(parameterIndex, xmlObject);
	}

	public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
		targetPreparedStatement.setObject(parameterIndex, x, targetSqlType, scaleOrLength);
	}

	public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException {
		targetPreparedStatement.setAsciiStream(parameterIndex, x, length);
	}

	public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException {
		targetPreparedStatement.setBinaryStream(parameterIndex, x, length);
	}

	public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
		targetPreparedStatement.setCharacterStream(parameterIndex, reader, length);
	}

	public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
		targetPreparedStatement.setAsciiStream(parameterIndex, x);
	}

	public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
		targetPreparedStatement.setBinaryStream(parameterIndex, x);
	}

	public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
		targetPreparedStatement.setCharacterStream(parameterIndex, reader);
	}

	public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
		targetPreparedStatement.setNCharacterStream(parameterIndex, value);
	}

	public void setClob(int parameterIndex, Reader reader) throws SQLException {
		targetPreparedStatement.setClob(parameterIndex, reader);
	}

	public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
		targetPreparedStatement.setBlob(parameterIndex, inputStream);
	}

	public void setNClob(int parameterIndex, Reader reader) throws SQLException {
		targetPreparedStatement.setNClob(parameterIndex, reader);
	}

}
